package io.finer.erp.jeecg.approve.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.finer.erp.jeecg.approve.entity.ApproveFlowNode;
import io.finer.erp.jeecg.approve.entity.ApproveMember;
import io.finer.erp.jeecg.approve.service.ApproveMemberService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 审批流节点 前端控制器
 * </p>
 *
 * @author yaoyifan
 * @since 2021-04-14
 */
@Api(tags="审批流节点")
@RestController
@RequestMapping("/approve/approveFlowNode")
public class ApproveFlowNodeController {

    @Autowired
    ApproveMemberService approveMemberService;

    @AutoLog(value = "审批流成员通过节点ID查询")
    @ApiOperation(value="审批流成员通过节点ID查询", notes="审批流成员-通节点ID查询")
    @GetMapping(value = "/queryLineByMainId")
    public Result<?> queryLineListByMainId(@RequestParam(name="id",required=true) String id) {
        QueryWrapper<ApproveMember> queryWrapper = new QueryWrapper<>();
        List<ApproveMember> approveFlowNodeList = approveMemberService.list(queryWrapper.eq("node_id", id));
        return Result.ok(approveFlowNodeList);
    }
}

